package com.example.a111;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.os.Bundle;
import android.widget.TextView;

import java.util.ArrayList;
import java.util.List;

public class MainActivity<adapter> extends AppCompatActivity {

    RecyclerView recyclerView;
    TextView textView1;
    TextView textView2;
    List list;
    Myadapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        recyclerView = findViewById(R.id.RecyclerView);
        textView1 = findViewById(R.id.textView1);
        textView2 = findViewById(R.id.textView2);

        list = new ArrayList<>();
        for (int i = 0; i < 5; i++) {
            list.add("this is No." + i + " item...");
        }

        adapter = new Myadapter(list,this);

        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);

        recyclerView.setAdapter(adapter);
        recyclerView.setLayoutManager(manager);

    }
}
